import http from "@/utils/request";

export const getCaptcha = () => http.get("/users/getCaptcha?v=next"); //获取验证码

export const verifyCaptcha = (captcha) =>
  http.get("/users/verifyCaptcha", {
    //验证 -验证码
    params: {
      captcha,
    },
  });

export const getSmsCode = (phoneNumber) =>
  http.post("/sms/send", {
    //获取短信验证码
    phoneNumber,
  });

export const smsLogin = (code) =>
  http.post("/users/login?type=sms", {
    //sms登录
    code,
  });

export const countLogin = (username, password) =>
  http.post("/users/login", {
    //账号登录
    username,
    password,
  });

export const freshQrcode = (sid) =>
  http.get("/users/getQrcode", { params: { sid } });

export const qrvLogin = (wechatCode) =>
  http.get("/users/wechatLogin", { params: { wechatCode } });
